//
//  RBCompeFootBallLiveView.m
//  RMMaterialRed
//
//  Created by XBWH on 2024/3/13.
//

#import "RBCompeFootBallLiveView.h"
#import "RBCompeLiveTextModel.h"

@interface RBCompeFootBallLiveView ()
@property (nonatomic,strong) UIView *topLineView;
@property (nonatomic,strong) UIView *bgView;
//球队
@property (nonatomic,strong) UIView *teamView;
@property (nonatomic,strong) UIView *teamLeftView;
@property (nonatomic,strong) UIButton *teamButton;

@property (nonatomic,strong) UIView *teamRightView;
@property (nonatomic,strong) UILabel *homeTeamLabel;
@property (nonatomic,strong) UILabel *visTeamLabel;
//进攻
@property (nonatomic,strong) UIView *attackView;
@property (nonatomic,strong) UIView *attackLeftView;
@property (nonatomic,strong) UIButton *attackButton;
@property (nonatomic,strong) UIView *attackRightView;
@property (nonatomic,strong) UILabel *homeAttLabel;
@property (nonatomic,strong) UILabel *visAttLabel;
//危险进攻球
@property (nonatomic,strong) UIView *dangerView;
@property (nonatomic,strong) UIView *dangerLeftView;
@property (nonatomic,strong) UIButton *dangerButton;
@property (nonatomic,strong) UIView *dangerRightView;
@property (nonatomic,strong) UILabel *homeDangLabel;
@property (nonatomic,strong) UILabel *visDangLabel;
//控球率
@property (nonatomic,strong) UIView *ballView;
@property (nonatomic,strong) UIView *ballLeftView;
@property (nonatomic,strong) UIButton *ballButton;
@property (nonatomic,strong) UIView *ballRightView;
@property (nonatomic,strong) UILabel *homeBallLabel;
@property (nonatomic,strong) UILabel *visBallLabel;
//射正球门
@property (nonatomic,strong) UIView *shootView;
@property (nonatomic,strong) UIView *shootLeftView;
@property (nonatomic,strong) UIButton *shootButton;
@property (nonatomic,strong) UIView *shootRightView;
@property (nonatomic,strong) UILabel *homeShootLabel;
@property (nonatomic,strong) UILabel *visShootLabel;
//射偏球门
@property (nonatomic,strong) UIView *offView;
@property (nonatomic,strong) UIView *offLeftView;
@property (nonatomic,strong) UIButton *offButton;
@property (nonatomic,strong) UIView *offRightView;
@property (nonatomic,strong) UILabel *homeOffLabel;
@property (nonatomic,strong) UILabel *visOffLabel;
//角球
@property (nonatomic,strong) UIView *cornerView;
@property (nonatomic,strong) UIView *cornerLeftView;
@property (nonatomic,strong) UIButton *cornerButton;
@property (nonatomic,strong) UIView *cornerRightView;
@property (nonatomic,strong) UILabel *homeCornLabel;
@property (nonatomic,strong) UILabel *visCornLabel;
//红牌
@property (nonatomic,strong) UIView *redView;
@property (nonatomic,strong) UIView *redLeftView;
@property (nonatomic,strong) UIButton *redButton;
@property (nonatomic,strong) UIView *redRightView;
@property (nonatomic,strong) UILabel *homeRedLabel;
@property (nonatomic,strong) UILabel *visRedLabel;
//黄牌
@property (nonatomic,strong) UIView *yellowView;
@property (nonatomic,strong) UIView *yellowLeftView;
@property (nonatomic,strong) UIButton *yellowButton;
@property (nonatomic,strong) UIView *yellowRightView;
@property (nonatomic,strong) UILabel *homeYellLabel;
@property (nonatomic,strong) UILabel *visYellLabel;
@end

@implementation RBCompeFootBallLiveView

- (instancetype)initWithFrame:(CGRect)frame{
    if(self = [super initWithFrame:frame]){
        [self rb_initViewUI];
        [self setNeedsLayout];
    }
    return self;
}
-(void)rb_initViewUI{
    [self addSubview:self.topLineView];
    [self addSubview:self.bgView];
    [self.bgView addSubview:self.teamView];
    [self.teamView addSubview:self.teamLeftView];
    [self.teamLeftView addSubview:self.homeTeamLabel];
    [self.teamView addSubview:self.teamRightView];
    [self.teamRightView addSubview:self.teamButton];
    [self.teamRightView addSubview:self.visTeamLabel];
    [self.bgView addSubview:self.attackView];
    [self.attackView addSubview:self.attackLeftView];
    [self.attackLeftView addSubview:self.homeAttLabel];
    [self.attackView addSubview:self.attackRightView];
    [self.attackRightView addSubview:self.attackButton];
    [self.attackRightView addSubview:self.visAttLabel];
    [self.bgView addSubview:self.dangerView];
    [self.dangerView addSubview:self.dangerLeftView];
    [self.dangerLeftView addSubview:self.homeDangLabel];
    [self.dangerView addSubview:self.dangerRightView];
    [self.dangerRightView addSubview:self.dangerButton];
    [self.dangerRightView addSubview:self.visDangLabel];
    [self.bgView addSubview:self.ballView];
    [self.ballView addSubview:self.ballLeftView];
    [self.ballLeftView addSubview:self.homeBallLabel];
    [self.ballView addSubview:self.ballRightView];
    [self.ballRightView addSubview:self.ballButton];
    [self.ballRightView addSubview:self.visBallLabel];
    [self.bgView addSubview:self.shootView];
    [self.shootView addSubview:self.shootLeftView];
    [self.shootLeftView addSubview:self.homeShootLabel];
    [self.shootView addSubview:self.shootRightView];
    [self.shootRightView addSubview:self.shootButton];
    [self.shootRightView addSubview:self.visShootLabel];
    [self.bgView addSubview:self.offView];
    [self.offView addSubview:self.offLeftView];
    [self.offLeftView addSubview:self.homeOffLabel];
    [self.offView addSubview:self.offRightView];
    [self.offRightView addSubview:self.offButton];
    [self.offRightView addSubview:self.visOffLabel];
    [self.bgView addSubview:self.cornerView];
    [self.cornerView addSubview:self.cornerLeftView];
    [self.cornerLeftView addSubview:self.homeCornLabel];
    [self.cornerView addSubview:self.cornerRightView];
    [self.cornerRightView addSubview:self.cornerButton];
    [self.cornerRightView addSubview:self.visCornLabel];
    [self.bgView addSubview:self.redView];
    [self.redView addSubview:self.redLeftView];
    [self.redLeftView addSubview:self.homeRedLabel];
    [self.redView addSubview:self.redRightView];
    [self.redRightView addSubview:self.redButton];
    [self.redRightView addSubview:self.visRedLabel];
    [self.bgView addSubview:self.yellowView];
    [self.yellowView addSubview:self.yellowLeftView];
    [self.yellowLeftView addSubview:self.homeYellLabel];
    [self.yellowView addSubview:self.yellowRightView];
    [self.yellowRightView addSubview:self.yellowButton];
    [self.yellowRightView addSubview:self.visYellLabel];
    
    [self.topLineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.right.mas_equalTo(0);
        make.height.mas_equalTo(RBScaleWidth(10));
    }];
    [self.bgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.topLineView.mas_bottom);
        make.left.mas_equalTo(RBScaleWidth(10));
        make.right.mas_equalTo(-RBScaleWidth(10));
        make.bottom.mas_equalTo(0);
    }];
    [self.teamView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(RBScaleWidth(10));
        make.left.mas_equalTo(0);
        make.right.mas_equalTo(0);
        make.height.mas_equalTo(RBScaleWidth(30));
    }];
    [self.teamLeftView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.bottom.mas_equalTo(0);
        make.width.mas_equalTo(RBScaleWidth(118));
    }];
    [self.homeTeamLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.right.bottom.mas_equalTo(0);
    }];
    
    [self.teamRightView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.right.bottom.mas_equalTo(0);
        make.left.mas_equalTo(self.teamLeftView.mas_right);
    }];
    [self.teamButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.bottom.mas_equalTo(0);
        make.width.mas_equalTo(RBScaleWidth(118));
    }];
    [self.teamButton rb_layoutButtonWithEdgeInsetsStyle:RBButtonEdgeInsetsStyleLeft imageTitleSpace:5];
    
    [self.visTeamLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.bottom.mas_equalTo(0);
        make.left.mas_equalTo(self.teamButton.mas_right);
        make.width.mas_equalTo(RBScaleWidth(118));
    }];
    
    [self.attackView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.teamView.mas_bottom);
        make.left.mas_equalTo(0);
        make.right.mas_equalTo(0);
        make.height.mas_equalTo(RBScaleWidth(30));
    }];
    [self.attackLeftView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.bottom.mas_equalTo(0);
        make.width.mas_equalTo(RBScaleWidth(118));
    }];
    [self.homeAttLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.right.bottom.mas_equalTo(0);
    }];
    
    [self.attackRightView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.right.bottom.mas_equalTo(0);
        make.left.mas_equalTo(self.attackLeftView.mas_right);
    }];
    [self.attackButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.bottom.mas_equalTo(0);
        make.width.mas_equalTo(RBScaleWidth(118));
    }];
    [self.attackButton rb_layoutButtonWithEdgeInsetsStyle:RBButtonEdgeInsetsStyleLeft imageTitleSpace:5];
    
    [self.visAttLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.bottom.mas_equalTo(0);
        make.left.mas_equalTo(self.attackButton.mas_right);
        make.width.mas_equalTo(RBScaleWidth(118));
    }];
    
    [self.dangerView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.attackView.mas_bottom);
        make.left.mas_equalTo(0);
        make.right.mas_equalTo(0);
        make.height.mas_equalTo(RBScaleWidth(30));
    }];
    [self.dangerLeftView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.bottom.mas_equalTo(0);
        make.width.mas_equalTo(RBScaleWidth(118));
    }];
    [self.homeDangLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.right.bottom.mas_equalTo(0);
    }];
    
    [self.dangerRightView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.right.bottom.mas_equalTo(0);
        make.left.mas_equalTo(self.dangerLeftView.mas_right);
    }];
    [self.dangerButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.bottom.mas_equalTo(0);
        make.width.mas_equalTo(RBScaleWidth(118));
    }];
    [self.dangerButton rb_layoutButtonWithEdgeInsetsStyle:RBButtonEdgeInsetsStyleLeft imageTitleSpace:5];
    [self.visDangLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.bottom.mas_equalTo(0);
        make.left.mas_equalTo(self.dangerButton.mas_right);
        make.width.mas_equalTo(RBScaleWidth(118));
    }];
    
    [self.ballView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.dangerView.mas_bottom);
        make.left.mas_equalTo(0);
        make.right.mas_equalTo(0);
        make.height.mas_equalTo(RBScaleWidth(30));
    }];
    [self.ballLeftView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.bottom.mas_equalTo(0);
        make.width.mas_equalTo(RBScaleWidth(118));
    }];
    [self.homeBallLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.right.bottom.mas_equalTo(0);
    }];
    
    [self.ballRightView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.right.bottom.mas_equalTo(0);
        make.left.mas_equalTo(self.ballLeftView.mas_right);
    }];
    [self.ballButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.bottom.mas_equalTo(0);
        make.width.mas_equalTo(RBScaleWidth(118));
    }];
    [self.ballButton rb_layoutButtonWithEdgeInsetsStyle:RBButtonEdgeInsetsStyleLeft imageTitleSpace:5];
    [self.visBallLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.bottom.mas_equalTo(0);
        make.left.mas_equalTo(self.ballButton.mas_right);
        make.width.mas_equalTo(RBScaleWidth(118));
    }];
    
    [self.shootView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.ballView.mas_bottom);
        make.left.mas_equalTo(0);
        make.right.mas_equalTo(0);
        make.height.mas_equalTo(RBScaleWidth(30));
    }];
    [self.shootLeftView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.bottom.mas_equalTo(0);
        make.width.mas_equalTo(RBScaleWidth(118));
    }];
    [self.homeShootLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.right.bottom.mas_equalTo(0);
    }];
    
    [self.shootRightView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.right.bottom.mas_equalTo(0);
        make.left.mas_equalTo(self.shootLeftView.mas_right);
    }];
    [self.shootButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.bottom.mas_equalTo(0);
        make.width.mas_equalTo(RBScaleWidth(118));
    }];
    [self.shootButton rb_layoutButtonWithEdgeInsetsStyle:RBButtonEdgeInsetsStyleLeft imageTitleSpace:5];
    [self.visShootLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.bottom.mas_equalTo(0);
        make.left.mas_equalTo(self.teamButton.mas_right);
        make.width.mas_equalTo(RBScaleWidth(118));
    }];
    
    [self.offView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.shootView.mas_bottom);
        make.left.mas_equalTo(0);
        make.right.mas_equalTo(0);
        make.height.mas_equalTo(RBScaleWidth(30));
    }];
    [self.offLeftView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.bottom.mas_equalTo(0);
        make.width.mas_equalTo(RBScaleWidth(118));
    }];
    [self.homeOffLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.right.bottom.mas_equalTo(0);
    }];
    
    [self.offRightView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.right.bottom.mas_equalTo(0);
        make.left.mas_equalTo(self.offLeftView.mas_right);
    }];
    [self.offButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.bottom.mas_equalTo(0);
        make.width.mas_equalTo(RBScaleWidth(118));
    }];
    [self.offButton rb_layoutButtonWithEdgeInsetsStyle:RBButtonEdgeInsetsStyleLeft imageTitleSpace:5];
    [self.visOffLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.bottom.mas_equalTo(0);
        make.left.mas_equalTo(self.offButton.mas_right);
        make.width.mas_equalTo(RBScaleWidth(118));
    }];
    
    [self.cornerView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.offView.mas_bottom);
        make.left.mas_equalTo(0);
        make.right.mas_equalTo(0);
        make.height.mas_equalTo(RBScaleWidth(30));
    }];
    [self.cornerLeftView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.bottom.mas_equalTo(0);
        make.width.mas_equalTo(RBScaleWidth(118));
    }];
    [self.homeCornLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.right.bottom.mas_equalTo(0);
    }];
    [self.cornerRightView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.right.bottom.mas_equalTo(0);
        make.left.mas_equalTo(self.cornerLeftView.mas_right);
    }];
    [self.cornerButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.bottom.mas_equalTo(0);
        make.width.mas_equalTo(RBScaleWidth(118));
    }];
    [self.cornerButton rb_layoutButtonWithEdgeInsetsStyle:RBButtonEdgeInsetsStyleLeft imageTitleSpace:5];
    [self.visCornLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.bottom.mas_equalTo(0);
        make.left.mas_equalTo(self.cornerButton.mas_right);
        make.width.mas_equalTo(RBScaleWidth(118));
    }];
    
    [self.redView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.cornerView.mas_bottom);
        make.left.mas_equalTo(0);
        make.right.mas_equalTo(0);
        make.height.mas_equalTo(RBScaleWidth(30));
    }];
    [self.redLeftView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.bottom.mas_equalTo(0);
        make.width.mas_equalTo(RBScaleWidth(118));
    }];
    [self.homeRedLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.right.bottom.mas_equalTo(0);
    }];
    [self.redRightView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.right.bottom.mas_equalTo(0);
        make.left.mas_equalTo(self.redLeftView.mas_right);
    }];
    [self.redButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.bottom.mas_equalTo(0);
        make.width.mas_equalTo(RBScaleWidth(118));
    }];
    [self.redButton rb_layoutButtonWithEdgeInsetsStyle:RBButtonEdgeInsetsStyleLeft imageTitleSpace:5];
    [self.visRedLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.bottom.mas_equalTo(0);
        make.left.mas_equalTo(self.redButton.mas_right);
        make.width.mas_equalTo(RBScaleWidth(118));
    }];
    
    [self.yellowView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.redView.mas_bottom);
        make.left.mas_equalTo(0);
        make.right.mas_equalTo(0);
        make.height.mas_equalTo(RBScaleWidth(30));
    }];
    [self.yellowLeftView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.bottom.mas_equalTo(0);
        make.width.mas_equalTo(RBScaleWidth(118));
    }];
    [self.homeYellLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.right.bottom.mas_equalTo(0);
    }];
    [self.yellowRightView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.right.bottom.mas_equalTo(0);
        make.left.mas_equalTo(self.yellowLeftView.mas_right);
    }];
    [self.yellowButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.bottom.mas_equalTo(0);
        make.width.mas_equalTo(RBScaleWidth(118));
    }];
    [self.yellowButton rb_layoutButtonWithEdgeInsetsStyle:RBButtonEdgeInsetsStyleLeft imageTitleSpace:5];
    [self.visYellLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.bottom.mas_equalTo(0);
        make.left.mas_equalTo(self.yellowButton.mas_right);
        make.width.mas_equalTo(RBScaleWidth(118));
    }];
}

- (void)setStatusArray:(NSMutableArray *)statusArray{
    _statusArray = statusArray;
    
    self.homeTeamLabel.text = self.homeNameZh;
    self.visTeamLabel.text = self.awayNameZh;
    
    for (RBCompeLiveStatsModel *model in statusArray) {
        if ([model.type intValue] == 23) {
            self.homeAttLabel.text = model.home;
            self.visAttLabel.text = model.away;
        }else if ([model.type intValue] == 24){
            self.homeDangLabel.text = model.home;
            self.visDangLabel.text = model.away;
        }else if ([model.type intValue] == 25){
            self.homeBallLabel.text = model.home;
            self.visBallLabel.text = model.away;
        }else if ([model.type intValue] == 21){
            self.homeShootLabel.text = model.home;
            self.visShootLabel.text = model.away;
        }else if ([model.type intValue] == 22){
            self.homeOffLabel.text = model.home;
            self.visOffLabel.text = model.away;
        }else if ([model.type intValue] == 2){
            self.homeCornLabel.text = model.home;
            self.visCornLabel.text = model.away;
        }else if ([model.type intValue] == 4){
            self.homeRedLabel.text = model.home;
            self.visRedLabel.text = model.away;
        }else if ([model.type intValue] == 3){
            self.homeYellLabel.text = model.home;
            self.visYellLabel.text = model.away;
        }
    }
}

- (UIView *)topLineView{
    if(_topLineView==nil){
        _topLineView = [[UIView alloc] init];
        _topLineView.backgroundColor = RBColor(242, 245, 250);
    }
    return _topLineView;
}
- (UIView *)bgView{
    if(_bgView==nil){
        _bgView = [[UIView alloc] init];
        _bgView.backgroundColor = [UIColor whiteColor];
    }
    return _bgView;
}
- (UIView *)teamView{
    if(_teamView==nil){
        _teamView = [[UIView alloc] init];
        _teamView.backgroundColor = [UIColor whiteColor];
    }
    return _teamView;
}
- (UIView *)teamLeftView{
    if(_teamLeftView==nil){
        _teamLeftView = [[UIView alloc] init];
        _teamLeftView.backgroundColor = [UIColor whiteColor];
    }
    return _teamLeftView;
}
- (UIButton *)teamButton{
    if(_teamButton==nil){
        _teamButton = [UIButton buttonWithType:UIButtonTypeCustom];
        [_teamButton setTitle:@"球队" forState:UIControlStateNormal];
        [_teamButton setImage:[UIImage imageNamed:@"icon_qd"] forState:UIControlStateNormal];
        [_teamButton setImage:[UIImage imageNamed:@"icon_qd"] forState:UIControlStateHighlighted];
        [_teamButton setTitleColor:RBColor(51, 51, 51) forState:UIControlStateNormal];
        _teamButton.titleLabel.font = RBPingFangFont(12);
    }
    return _teamButton;
}
- (UIView *)teamRightView{
    if(_teamRightView==nil){
        _teamRightView = [[UIView alloc] init];
        _teamRightView.backgroundColor = [UIColor whiteColor];
    }
    return _teamRightView;
}
-(UILabel *)homeTeamLabel{
    if(_homeTeamLabel==nil){
        _homeTeamLabel = [UILabel rb_labelWithTitle:@"-" color:RBColor(76, 136, 255) font:RBPingFangMediumFont(13) alignment:NSTextAlignmentCenter];
        _homeTeamLabel.backgroundColor = RBColor(255, 255, 255);
    }
    return _homeTeamLabel;
}
-(UILabel *)visTeamLabel{
    if(_visTeamLabel==nil){
        _visTeamLabel = [UILabel rb_labelWithTitle:@"-" color:RBColor(242, 48, 48) font:RBPingFangMediumFont(13) alignment:NSTextAlignmentCenter];
        _visTeamLabel.backgroundColor = RBColor(255, 255, 255);
    }
    return _visTeamLabel;
}
- (UIView *)attackView{
    if(_attackView==nil){
        _attackView = [[UIView alloc] init];
        _attackView.backgroundColor = [UIColor whiteColor];
    }
    return _attackView;
}
- (UIView *)attackLeftView{
    if(_attackLeftView==nil){
        _attackLeftView = [[UIView alloc] init];
        _attackLeftView.backgroundColor = [UIColor whiteColor];
    }
    return _attackLeftView;
}
- (UIButton *)attackButton{
    if(_attackButton==nil){
        _attackButton = [UIButton buttonWithType:UIButtonTypeCustom];
        [_attackButton setTitle:@"进攻" forState:UIControlStateNormal];
        [_attackButton setImage:[UIImage imageNamed:@"icon_jg"] forState:UIControlStateNormal];
        [_attackButton setImage:[UIImage imageNamed:@"icon_jg"] forState:UIControlStateHighlighted];
        [_attackButton setTitleColor:RBColor(51, 51, 51) forState:UIControlStateNormal];
        _attackButton.titleLabel.font = RBPingFangFont(12);
    }
    return _attackButton;
}
- (UIView *)attackRightView{
    if(_attackRightView==nil){
        _attackRightView = [[UIView alloc] init];
        _attackRightView.backgroundColor = [UIColor whiteColor];
    }
    return _attackRightView;
}
-(UILabel *)homeAttLabel{
    if(_homeAttLabel==nil){
        _homeAttLabel = [UILabel rb_labelWithTitle:@"0" color:RBColor(76, 136, 255) font:RBPingFangFont(13) alignment:NSTextAlignmentCenter];
        _homeAttLabel.backgroundColor = RBColor(255, 255, 255);
    }
    return _homeAttLabel;
}
-(UILabel *)visAttLabel{
    if(_visAttLabel==nil){
        _visAttLabel = [UILabel rb_labelWithTitle:@"0" color:RBColor(242, 48, 48) font:RBPingFangFont(13) alignment:NSTextAlignmentCenter];
        _visAttLabel.backgroundColor = RBColor(255, 255, 255);
    }
    return _visAttLabel;
}
- (UIView *)dangerView{
    if(_dangerView==nil){
        _dangerView = [[UIView alloc] init];
        _dangerView.backgroundColor = [UIColor whiteColor];
    }
    return _dangerView;
}
- (UIView *)dangerLeftView{
    if(_dangerLeftView==nil){
        _dangerLeftView = [[UIView alloc] init];
        _dangerLeftView.backgroundColor = [UIColor whiteColor];
    }
    return _dangerLeftView;
}
- (UIButton *)dangerButton{
    if(_dangerButton==nil){
        _dangerButton = [UIButton buttonWithType:UIButtonTypeCustom];
        [_dangerButton setTitle:@"危险进攻" forState:UIControlStateNormal];
        [_dangerButton setImage:[UIImage imageNamed:@"icon_wxjg"] forState:UIControlStateNormal];
        [_dangerButton setImage:[UIImage imageNamed:@"icon_wxjg"] forState:UIControlStateHighlighted];
        [_dangerButton setTitleColor:RBColor(51, 51, 51) forState:UIControlStateNormal];
        _dangerButton.titleLabel.font = RBPingFangFont(12);
    }
    return _dangerButton;
}
- (UIView *)dangerRightView{
    if(_dangerRightView==nil){
        _dangerRightView = [[UIView alloc] init];
        _dangerRightView.backgroundColor = [UIColor whiteColor];
    }
    return _dangerRightView;
}
-(UILabel *)homeDangLabel{
    if(_homeDangLabel==nil){
        _homeDangLabel = [UILabel rb_labelWithTitle:@"0" color:RBColor(76, 136, 255) font:RBPingFangFont(13) alignment:NSTextAlignmentCenter];
        _homeDangLabel.backgroundColor = RBColor(255, 255, 255);
    }
    return _homeDangLabel;
}
-(UILabel *)visDangLabel{
    if(_visDangLabel==nil){
        _visDangLabel = [UILabel rb_labelWithTitle:@"0" color:RBColor(242, 48, 48) font:RBPingFangFont(13) alignment:NSTextAlignmentCenter];
        _visDangLabel.backgroundColor = RBColor(255, 255, 255);
    }
    return _visDangLabel;
}
- (UIView *)ballView{
    if(_ballView==nil){
        _ballView = [[UIView alloc] init];
        _ballView.backgroundColor = [UIColor whiteColor];
    }
    return _ballView;
}
- (UIView *)ballLeftView{
    if(_ballLeftView==nil){
        _ballLeftView = [[UIView alloc] init];
        _ballLeftView.backgroundColor = [UIColor whiteColor];
    }
    return _ballLeftView;
}
- (UIButton *)ballButton{
    if(_ballButton==nil){
        _ballButton = [UIButton buttonWithType:UIButtonTypeCustom];
        [_ballButton setTitle:@"控球率" forState:UIControlStateNormal];
        [_ballButton setImage:[UIImage imageNamed:@"icon_kql"] forState:UIControlStateNormal];
        [_ballButton setImage:[UIImage imageNamed:@"icon_kql"] forState:UIControlStateHighlighted];
        [_ballButton setTitleColor:RBColor(51, 51, 51) forState:UIControlStateNormal];
        _ballButton.titleLabel.font = RBPingFangFont(12);
    }
    return _ballButton;
}
- (UIView *)ballRightView{
    if(_ballRightView==nil){
        _ballRightView = [[UIView alloc] init];
        _ballRightView.backgroundColor = [UIColor whiteColor];
    }
    return _ballRightView;
}
-(UILabel *)homeBallLabel{
    if(_homeBallLabel==nil){
        _homeBallLabel = [UILabel rb_labelWithTitle:@"0" color:RBColor(76, 136, 255) font:RBPingFangFont(13) alignment:NSTextAlignmentCenter];
        _homeBallLabel.backgroundColor = RBColor(255, 255, 255);
    }
    return _homeBallLabel;
}
-(UILabel *)visBallLabel{
    if(_visBallLabel==nil){
        _visBallLabel = [UILabel rb_labelWithTitle:@"0" color:RBColor(242, 48, 48) font:RBPingFangFont(13) alignment:NSTextAlignmentCenter];
        _visBallLabel.backgroundColor = RBColor(255, 255, 255);
    }
    return _visBallLabel;
}
- (UIView *)shootView{
    if(_shootView==nil){
        _shootView = [[UIView alloc] init];
        _shootView.backgroundColor = [UIColor whiteColor];
    }
    return _shootView;
}
- (UIView *)shootLeftView{
    if(_shootLeftView==nil){
        _shootLeftView = [[UIView alloc] init];
        _shootLeftView.backgroundColor = [UIColor whiteColor];
    }
    return _shootLeftView;
}
- (UIButton *)shootButton{
    if(_shootButton==nil){
        _shootButton = [UIButton buttonWithType:UIButtonTypeCustom];
        [_shootButton setTitle:@"射正球门" forState:UIControlStateNormal];
        [_shootButton setImage:[UIImage imageNamed:@"icon_szqm"] forState:UIControlStateNormal];
        [_shootButton setImage:[UIImage imageNamed:@"icon_szqm"] forState:UIControlStateHighlighted];
        [_shootButton setTitleColor:RBColor(51, 51, 51) forState:UIControlStateNormal];
        _shootButton.titleLabel.font = RBPingFangFont(12);
    }
    return _shootButton;
}
- (UIView *)shootRightView{
    if(_shootRightView==nil){
        _shootRightView = [[UIView alloc] init];
        _shootRightView.backgroundColor = [UIColor whiteColor];
    }
    return _shootRightView;
}
-(UILabel *)homeShootLabel{
    if(_homeShootLabel==nil){
        _homeShootLabel = [UILabel rb_labelWithTitle:@"0" color:RBColor(76, 136, 255) font:RBPingFangFont(13) alignment:NSTextAlignmentCenter];
        _homeShootLabel.backgroundColor = RBColor(255, 255, 255);
    }
    return _homeShootLabel;
}
-(UILabel *)visShootLabel{
    if(_visShootLabel==nil){
        _visShootLabel = [UILabel rb_labelWithTitle:@"0" color:RBColor(242, 48, 48) font:RBPingFangFont(13) alignment:NSTextAlignmentCenter];
        _visShootLabel.backgroundColor = RBColor(255, 255, 255);
    }
    return _visShootLabel;
}
- (UIView *)offView{
    if(_offView==nil){
        _offView = [[UIView alloc] init];
        _offView.backgroundColor = [UIColor whiteColor];
    }
    return _offView;
}
- (UIView *)offLeftView{
    if(_offLeftView==nil){
        _offLeftView = [[UIView alloc] init];
        _offLeftView.backgroundColor = [UIColor whiteColor];
    }
    return _offLeftView;
}
- (UIButton *)offButton{
    if(_offButton==nil){
        _offButton = [UIButton buttonWithType:UIButtonTypeCustom];
        [_offButton setTitle:@"射偏球门" forState:UIControlStateNormal];
        [_offButton setImage:[UIImage imageNamed:@"icon_spqm"] forState:UIControlStateNormal];
        [_offButton setImage:[UIImage imageNamed:@"icon_spqm"] forState:UIControlStateHighlighted];
        [_offButton setTitleColor:RBColor(51, 51, 51) forState:UIControlStateNormal];
        _offButton.titleLabel.font = RBPingFangFont(12);
    }
    return _offButton;
}
- (UIView *)offRightView{
    if(_offRightView==nil){
        _offRightView = [[UIView alloc] init];
        _offRightView.backgroundColor = [UIColor whiteColor];
    }
    return _offRightView;
}
-(UILabel *)homeOffLabel{
    if(_homeOffLabel==nil){
        _homeOffLabel = [UILabel rb_labelWithTitle:@"0" color:RBColor(76, 136, 255) font:RBPingFangFont(13) alignment:NSTextAlignmentCenter];
        _homeOffLabel.backgroundColor = RBColor(255, 255, 255);
    }
    return _homeOffLabel;
}
-(UILabel *)visOffLabel{
    if(_visOffLabel==nil){
        _visOffLabel = [UILabel rb_labelWithTitle:@"0" color:RBColor(242, 48, 48) font:RBPingFangFont(13) alignment:NSTextAlignmentCenter];
        _visOffLabel.backgroundColor = RBColor(255, 255, 255);
    }
    return _visOffLabel;
}
- (UIView *)cornerView{
    if(_cornerView==nil){
        _cornerView = [[UIView alloc] init];
        _cornerView.backgroundColor = [UIColor whiteColor];
    }
    return _cornerView;
}
- (UIView *)cornerLeftView{
    if(_cornerLeftView==nil){
        _cornerLeftView = [[UIView alloc] init];
        _cornerLeftView.backgroundColor = [UIColor whiteColor];
    }
    return _cornerLeftView;
}
- (UIButton *)cornerButton{
    if(_cornerButton==nil){
        _cornerButton = [UIButton buttonWithType:UIButtonTypeCustom];
        [_cornerButton setTitle:@"角球" forState:UIControlStateNormal];
        [_cornerButton setImage:[UIImage imageNamed:@"icon_jq"] forState:UIControlStateNormal];
        [_cornerButton setImage:[UIImage imageNamed:@"icon_jq"] forState:UIControlStateHighlighted];
        [_cornerButton setTitleColor:RBColor(51, 51, 51) forState:UIControlStateNormal];
        _cornerButton.titleLabel.font = RBPingFangFont(12);
    }
    return _cornerButton;
}
- (UIView *)cornerRightView{
    if(_cornerRightView==nil){
        _cornerRightView = [[UIView alloc] init];
        _cornerRightView.backgroundColor = [UIColor whiteColor];
    }
    return _cornerRightView;
}
-(UILabel *)homeCornLabel{
    if(_homeCornLabel==nil){
        _homeCornLabel = [UILabel rb_labelWithTitle:@"0" color:RBColor(76, 136, 255) font:RBPingFangFont(13) alignment:NSTextAlignmentCenter];
        _homeCornLabel.backgroundColor = RBColor(255, 255, 255);
    }
    return _homeCornLabel;
}
-(UILabel *)visCornLabel{
    if(_visCornLabel==nil){
        _visCornLabel = [UILabel rb_labelWithTitle:@"0" color:RBColor(242, 48, 48) font:RBPingFangFont(13) alignment:NSTextAlignmentCenter];
        _visCornLabel.backgroundColor = RBColor(255, 255, 255);
    }
    return _visCornLabel;
}
- (UIView *)redView{
    if(_redView==nil){
        _redView = [[UIView alloc] init];
        _redView.backgroundColor = [UIColor whiteColor];
    }
    return _redView;
}
- (UIView *)redLeftView{
    if(_redLeftView==nil){
        _redLeftView = [[UIView alloc] init];
        _redLeftView.backgroundColor = [UIColor whiteColor];
    }
    return _redLeftView;
}
- (UIButton *)redButton{
    if(_redButton==nil){
        _redButton = [UIButton buttonWithType:UIButtonTypeCustom];
        [_redButton setTitle:@"红牌" forState:UIControlStateNormal];
        [_redButton setImage:[UIImage imageNamed:@"icon_hp"] forState:UIControlStateNormal];
        [_redButton setImage:[UIImage imageNamed:@"icon_hp"] forState:UIControlStateHighlighted];
        [_redButton setTitleColor:RBColor(51, 51, 51) forState:UIControlStateNormal];
        _redButton.titleLabel.font = RBPingFangFont(12);
    }
    return _redButton;
}
- (UIView *)redRightView{
    if(_redRightView==nil){
        _redRightView = [[UIView alloc] init];
        _redRightView.backgroundColor = [UIColor whiteColor];
    }
    return _redRightView;
}
-(UILabel *)homeRedLabel{
    if(_homeRedLabel==nil){
        _homeRedLabel = [UILabel rb_labelWithTitle:@"0" color:RBColor(76, 136, 255) font:RBPingFangFont(13) alignment:NSTextAlignmentCenter];
        _homeRedLabel.backgroundColor = RBColor(255, 255, 255);
    }
    return _homeRedLabel;
}
-(UILabel *)visRedLabel{
    if(_visRedLabel==nil){
        _visRedLabel = [UILabel rb_labelWithTitle:@"0" color:RBColor(242, 48, 48) font:RBPingFangFont(13) alignment:NSTextAlignmentCenter];
        _visRedLabel.backgroundColor = RBColor(255, 255, 255);
    }
    return _visRedLabel;
}
- (UIView *)yellowView{
    if(_yellowView==nil){
        _yellowView = [[UIView alloc] init];
        _yellowView.backgroundColor = [UIColor whiteColor];
    }
    return _yellowView;
}
- (UIView *)yellowLeftView{
    if(_yellowLeftView==nil){
        _yellowLeftView = [[UIView alloc] init];
        _yellowLeftView.backgroundColor = [UIColor whiteColor];
    }
    return _yellowLeftView;
}
- (UIButton *)yellowButton{
    if(_yellowButton==nil){
        _yellowButton = [UIButton buttonWithType:UIButtonTypeCustom];
        [_yellowButton setTitle:@"黄牌" forState:UIControlStateNormal];
        [_yellowButton setImage:[UIImage imageNamed:@"icon_chp"] forState:UIControlStateNormal];
        [_yellowButton setImage:[UIImage imageNamed:@"icon_chp"] forState:UIControlStateHighlighted];
        [_yellowButton setTitleColor:RBColor(51, 51, 51) forState:UIControlStateNormal];
        _yellowButton.titleLabel.font = RBPingFangFont(12);
    }
    return _yellowButton;
}
- (UIView *)yellowRightView{
    if(_yellowRightView==nil){
        _yellowRightView = [[UIView alloc] init];
        _yellowRightView.backgroundColor = [UIColor whiteColor];
    }
    return _yellowRightView;
}
-(UILabel *)homeYellLabel{
    if(_homeYellLabel==nil){
        _homeYellLabel = [UILabel rb_labelWithTitle:@"0" color:RBColor(76, 136, 255) font:RBPingFangFont(13) alignment:NSTextAlignmentCenter];
        _homeYellLabel.backgroundColor = RBColor(255, 255, 255);
    }
    return _homeYellLabel;
}
-(UILabel *)visYellLabel{
    if(_visYellLabel==nil){
        _visYellLabel = [UILabel rb_labelWithTitle:@"0" color:RBColor(242, 48, 48) font:RBPingFangFont(13) alignment:NSTextAlignmentCenter];
        _visYellLabel.backgroundColor = RBColor(255, 255, 255);
    }
    return _visYellLabel;
}


@end
